<?php

namespace App\Http\Controllers\Admin;
use App\Models\NotifyLog;


/**
 * 支付回调日志管理控制器
 */
class NotifyLogController extends BaseController
{

    public function __construct(NotifyLog $notifyLog)
    {
        parent::__construct();
        $this->notifyLog = $notifyLog;
    }
    
    public function getIndex()
    {
//        $result = [
//            'out_trade_no'=>'580586111312564020',
//            'openid' =>'ocu9M5UAUDeJkNAapQHWWw5u1zPg',
//            'return_code' =>'FAIL',
//            'result_code' =>'FAIL',
//            'transaction_id' =>'823132134231321231',
//        ];
//        $errmsg = '你就是个杯具';
//        $this->notifyLog->add(1,$result,$errmsg);
        $rows = $this->notifyLog->getLogList();
//        dd($rows);
        return view('admin.notify_log.index', compact('rows'));
    }

    public function getClear()
    {
        $this->notifyLog->clear();
        return $this->success('操作成功');
    }

}
